window.onload=function(){
	//当前页面导航栏按钮变深蓝色
	$(".reminders").css("backgroundColor","#224247").siblings().css("backgroundColor","#365d62");
	//搜索
	$(".filterQueryBtn").click(function(){
		var device_code = $(".chargeQueryInput").val();
		if(device_code=="%"){
			hint("非法输入，请正确输入编号！");
		}else{
			window.location.href="/admin/device/reminder/filter?condition="+device_code;
		}
	})
	//勾选框按钮
	$(".checkedBox").click(function(){
		$(".remindersLabelBox").html("");
		var _this=$(this);
		if(!_this.hasClass("checkedBoxBg")){
			layui.use('layer', function(){
			  	var layer = layui.layer;
			  	layer.open({
					type: 1, 
					title: ['是否已提醒用户', 'font-size:18px;'],
					area: ['500px', '300px'],
				  	content: $(".checkHintBox"),
				}); 
			});
			//取消按钮
			$('.filternoBtn').unbind('click').click(function(){
				window.location.reload();
			})
			//确定按钮
			$(".filterYesBtn").unbind('click').click(function(){
				$.ajax({
					url:"/admin/api/device/filter",
					type:"post",
					dataType:"json",
					data:{
						id:_this.siblings("input").val(),
						filter_status:1
					},
					success:function(data){
						if(data.status.errCode == 0){
							_this.addClass("checkedBoxBg");
							$(".filterHintNum").html(data.data.count);
							$(".remindersLabelBox").html("操作成功");
						}else{
							$(".remindersLabelBox").html(data.status.message);
						}
					}
				});
			});
		}
	});
}